* make gbversion.h, setup.iss generated files.
add cmake documentation targets.
* work on check.
* simplify parameter passing to test scripts.
* cmake test work.
run vtesto in parallel.
fix valgrind decision making in testo.
fix test for gpsbabel executable with blanks in path.
* update vtesto for cmake.
* simplify option passing for testo.
* simplify valgrind detection in testo.
* fix testo bug.
* add ubuntu cmake build.
* fix workflow
* align gui pro and CMakeLists.
and use target properties
run: |
./build_and_test
+ cmake:
+ name: cmake Build
+ runs-on: ubuntu-latest
+ container:
+ image: gpsbabel-docker.jfrog.io/tsteven4/gpsbabel_build_environment_focal
+ env:
+ LC_ALL: 'C.UTF-8'
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+
+ - name: build_and_test
+ run: |
+ ./tools/build_and_test_cmake
+
qtio_gcc:
name: qtio gcc Build
runs-on: ubuntu-latest
/autogen/
/makedoc
/empty
+/gbversion.h
+/qrc_gpsbabel.cpp
cmake_minimum_required(VERSION 3.11)
-project(gpsbabel LANGUAGES C CXX)
+include(gbversion.cmake)
+configure_file(gbversion.h.in gbversion.h @ONLY NEWLINE_STYLE LF)
+project(gpsbabel LANGUAGES C CXX VERSION ${GB.VERSION})
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
message(STATUS "Include Directores are: \"${IncDirs}\"")
if(UNIX)
- # the tests only work if the pwd is top level source dir due to the file name getting embedded in the file nonexistent.err.
- add_custom_target(check cd ${CMAKE_SOURCE_DIR}\; PNAME=${CMAKE_BINARY_DIR}/gpsbabel ./testo DEPENDS gpsbabel)
+ # This test only works if the pwd is top level source dir due to the
+ # file name getting embedded in the file nonexistent.err.
+ add_custom_target(check
+ ${CMAKE_SOURCE_DIR}/testo -p $<TARGET_FILE:gpsbabel>
+ DEPENDS gpsbabel
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ VERBATIM)
+endif()
+if(UNIX AND NOT APPLE)
+ # This test only works if the pwd is top level source dir due to the
+ #file name getting embedded in the file nonexistent.err.
+ file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/testo.d)
+ add_custom_target(check-vtesto
+ find testo.d -maxdepth 1 -name "*.test" -print0 | xargs -0 basename -s .test | sort |
+ xargs -n 1 -P 3 -I TESTNAME ${CMAKE_SOURCE_DIR}/vtesto
+ -l -j ${CMAKE_BINARY_DIR}/testo.d/TESTNAME.vglog -p $<TARGET_FILE:gpsbabel> TESTNAME
+ DEPENDS gpsbabel
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ VERBATIM)
+endif()
+
+if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
+ set(WEB "../babelweb" CACHE PATH "Path where the documentation will be stored for www.gpsbabel.org.")
+ # If using a makefile generator WEB can be overridden on the make
+ # command line, e.g. make gpsbabel.org WEB=/tmp. If not overridden on
+ # the make command line, or not using a makefile generator, or if using
+ # "cmake --build dir --target gpsbabel.org", then the cache variable
+ # WEB will be used. The cache variable can be overridden in the usual
+ # way when configuring, i.e. "cmake dir -DWEB:PATH=/tmp".
+
+ # FIXME: Is overriding WEB on the make command line worth the trouble of
+ # using configure_file to build a wrapper script?
+
+ configure_file(${CMAKE_SOURCE_DIR}/tools/make_gpsbabel_org_wrapper.sh.in
+ ${CMAKE_BINARY_DIR}/tools/make_gpsbabel_org_wrapper.sh
+ @ONLY
+ NEWLINE_STYLE LF)
+ add_custom_target(gpsbabel.org
+ ${CMAKE_BINARY_DIR}/tools/make_gpsbabel_org_wrapper.sh
+ DEPENDS gpsbabel gpsbabel.pdf)
+endif()
+
+if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
+ add_custom_target(gpsbabel.html
+ ${CMAKE_SOURCE_DIR}/tools/make_gpsbabel_html.sh
+ DEPENDS gpsbabel)
+endif()
+
+if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
+ add_custom_target(gpsbabel.pdf
+ ${CMAKE_SOURCE_DIR}/tools/make_gpsbabel_pdf.sh
+ DEPENDS gpsbabel)
endif()
# Enforce minimum Qt version.
-# versionAtLeast() was introduced in Qt 5.10, so we can't count on it being available.
+# versionAtLeast() was introduced in Qt 5.10, so we cannot count on it being available.
MIN_QT_VERSION = 5.12 # major[.minor[.patch]]
MIN_QT_VERSION_COMPONENTS = $$split(MIN_QT_VERSION, .)
MIN_QT_VERSION_MAJOR = $$member(MIN_QT_VERSION_COMPONENTS, 0)
QT -= gui
versionAtLeast(QT_VERSION, 6.0): QT += core5compat
+# set VERSION related variables and generate gbversion.h
+include(gbversion.pri)
+
TARGET = gpsbabel
-VERSION = 1.7.0
+VERSION = $$GB.VERSION
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
-# use GB variable to express ownership intention and
-# avoid conflict with documented and undocumented qmake variables
-GB.VERSION_COMPONENTS = $$split(VERSION, .)
-GB.MAJOR = $$member(GB.VERSION_COMPONENTS, 0)
-GB.MINOR = $$member(GB.VERSION_COMPONENTS, 1)
-GB.MICRO = $$member(GB.VERSION_COMPONENTS, 2)
-# Increase GB.BUILD for a new release (why? Where is this ever used?)
-# A: it's used by win32/gpsbabel.rc which includes gbversion.h
-GB.BUILD = 31
-# GB.PACKAGE_RELEASE = "-beta20190413"
-
-# may be overwridden on qmake command line
-!defined(DOCVERSION, var) {
- DOCVERSION=$${VERSION}
-}
-
-# may be overwridden on qmake command line
-!defined(WEB, var) {
- WEB = ../babelweb
-}
-
-# use undocumented QMAKE_SUBSTITUTES variable to emulate AC_CONFIG_FILES
-GB.versionfile.input = gbversion.h.qmake.in
-GB.versionfile.output = gbversion.h
-QMAKE_SUBSTITUTES += GB.versionfile
-GB.setupfile.input = gui/setup.iss.qmake.in
-GB.setupfile.output = gui/setup.iss
-QMAKE_SUBSTITUTES += GB.setupfile
-
# RESOURCES
RESOURCES = gpsbabel.qrc
gpsbabel.org.depends = gpsbabel gpsbabel.pdf FORCE
equals(PWD, $${OUT_PWD}) {
+ # may be overridden on qmake command line
+ !defined(WEB, var) {
+ WEB = ../babelweb
+ }
+ # Allow WEB to be overridden when running make.
+ # DOCVERSION must be overridden at qmake time as it also affects the object code.
gpsbabel.org.commands += web=\$\${WEB:-$${WEB}};
- gpsbabel.org.commands += docversion=\$\${DOCVERSION:-$${DOCVERSION}};
- gpsbabel.org.commands += tools/make_gpsbabel_org.sh \"\$\${web}\" \"\$\${docversion}\";
+ gpsbabel.org.commands += tools/make_gpsbabel_org.sh \"\$\${web}\" $$shell_quote($$DOCVERSION);
} else {
gpsbabel.org.commands += echo "target gpsbabel.org is not supported for out of source builds.";
gpsbabel.org.commands += exit 1;
--- /dev/null
+# Use GB variable to express ownership intention and avoid conflict with
+# documented and undocumented cmake variables.
+
+# Until we do a hierarchical build the build directory for gpsbabel and
+# the build directory for GPSBabelFE are independent. Only the source
+# directories have a known relationship. Including this pri file from the
+# source tree will generate the version file in the current build directory.
+
+# Note some of these variables are also used in the gui to generate setup.iss.
+# Note some of these variables are also used in the cli to generate documents.
+
+# FIXME: when we have a hierarchical build we can set the version directly
+# in the top level CMakeLists.txt file, and the version components will
+# be automatically available in as variables. But today we have multiple
+# independent CMakeLists.txt files all with their own project commands.
+# By defining the version here we minimize the number of locations
+# containing the definition to gbversion.pri and gbversion.cmake.
+
+set(GB.VERSION 1.7.0) # also change in gbversion.pri
+string(REPLACE "." ";" VERSION_COMPONENTS ${GB.VERSION})
+list(GET VERSION_COMPONENTS 0 GB.MAJOR)
+list(GET VERSION_COMPONENTS 1 GB.MINOR)
+list(GET VERSION_COMPONENTS 2 GB.MICRO)
+# Increase GB.BUILD for a new release (why? Where is this ever used?)
+# A: it's used by win32/gpsbabel.rc which includes gbversion.h
+set(GB.BUILD 31 CACHE STRING "Fourth component of Windows VERSIONINFO resource FILEVERSION and PRODUCTVERSION parameters.")
+set(GB.PACKAGE_RELEASE "" CACHE STRING "String to append to VERSION tuple.") # .e.g. "-beta20190413"
+
+# may be overridden on cmake command line
+set(DOCVERSION ${GB.VERSION} CACHE STRING "String appended to documentation location for www.gpsbabel.org.")
+++ /dev/null
-/*
- * gbversion.h is generated from gbversion.h.in which uses autoconf voodoo
- * to get the version number from configure.ac.
- *
- * Isn't simplification via automation grand?
- */
-#ifdef RC_INVOKED
-// These defines are for the Microsoft resource compiler scripts
-// win32/gpsbabel.rc and gui/app.rc
-#define VER_FILE 1,7,0,31
-#define VER_PRODUCT 1,7,0,31
-#define VER_FILE_STR "1.7.0"
-#define VER_PRODUCT_STR "1.7.0"
-#else
-#define VERSION "1.7.0"
-#define WEB_DOC_DIR "https://www.gpsbabel.org/htmldoc-1.7.0"
-#endif
#ifdef RC_INVOKED
// These defines are for the Microsoft resource compiler scripts
// win32/gpsbabel.rc and gui/app.rc
-#define VER_FILE @GBMAJOR@,@GBMINOR@,@GBMICRO@,@GBBUILD@
-#define VER_PRODUCT @GBMAJOR@,@GBMINOR@,@GBMICRO@,@GBBUILD@
-#define VER_FILE_STR "@GBMAJOR@.@GBMINOR@.@GBMICRO@@PACKAGE_RELEASE@"
-#define VER_PRODUCT_STR "@GBMAJOR@.@GBMINOR@.@GBMICRO@@PACKAGE_RELEASE@"
+#define VER_FILE @GB.MAJOR@,@GB.MINOR@,@GB.MICRO@,@GB.BUILD@
+#define VER_PRODUCT @GB.MAJOR@,@GB.MINOR@,@GB.MICRO@,@GB.BUILD@
+#define VER_FILE_STR "@GB.MAJOR@.@GB.MINOR@.@GB.MICRO@@GB.PACKAGE_RELEASE@"
+#define VER_PRODUCT_STR "@GB.MAJOR@.@GB.MINOR@.@GB.MICRO@@GB.PACKAGE_RELEASE@"
#else
-#define VERSION "@GBMAJOR@.@GBMINOR@.@GBMICRO@@PACKAGE_RELEASE@"
+#define VERSION "@GB.MAJOR@.@GB.MINOR@.@GB.MICRO@@GB.PACKAGE_RELEASE@"
#define WEB_DOC_DIR "https://www.gpsbabel.org/htmldoc-@DOCVERSION@"
#endif
--- /dev/null
+# Use GB variable to express ownership intention and avoid conflict with
+# documented and undocumented qmake variables.
+
+# Until we do a hierarchical build the build directory for gpsbabel and
+# the build directory for GPSBabelFE are independent. Only the source
+# directories have a known relationship. Including this pri file from the
+# source tree will generate the version file in the current build directory.
+
+# Note some of these variables are also used in the gui to generate setup.iss.
+# Note some of these variables are also used in the cli to generate documents.
+
+# FIXME: Today we have multiple independent .pro files. By defining
+# the version here we minimize the number of locations containing the
+# definition to gbversion.pri and gbversion.cmake. When we retire qmake
+# we will be back to only one place for version to be defined.
+
+GB.VERSION = 1.7.0 # Also change in gbversion.cmake
+GB.VERSION_COMPONENTS = $$split(GB.VERSION, .)
+GB.MAJOR = $$member(GB.VERSION_COMPONENTS, 0)
+GB.MINOR = $$member(GB.VERSION_COMPONENTS, 1)
+GB.MICRO = $$member(GB.VERSION_COMPONENTS, 2)
+# Increase GB.BUILD for a new release (why? Where is this ever used?)
+# A: it's used by win32/gpsbabel.rc which includes gbversion.h
+GB.BUILD = 31
+# GB.PACKAGE_RELEASE = "-beta20190413"
+
+# may be overridden on qmake command line
+!defined(DOCVERSION, var) {
+DOCVERSION=$${GB.VERSION}
+}
+
+# use undocumented QMAKE_SUBSTITUTES variable to emulate AC_CONFIG_FILES
+# Note $${PWD} is relative to the location of this file.
+GB.versionfile.input = $${PWD}/gbversion.h.qmake.in
+GB.versionfile.output = gbversion.h
+QMAKE_SUBSTITUTES += GB.versionfile
/tmp/
/release/
/debug/
+/gbversion.h
+/setup.iss
cmake_minimum_required(VERSION 3.11)
-project(gpsbabelfe LANGUAGES CXX)
+include(../gbversion.cmake)
+configure_file(../gbversion.h.in gbversion.h @ONLY NEWLINE_STYLE LF)
+configure_file(setup.iss.in setup.iss @ONLY NEWLINE_STYLE CRLF)
+project(gpsbabelfe LANGUAGES CXX VERSION ${GB.VERSION})
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
if(UNIX AND NOT APPLE)
set(TARGET gpsbabelfe)
- set(CMAKE_RUNTIME_OUTPUT_DIRECTORY GPSBabelFE)
else()
set(TARGET GPSBabelFE)
endif()
target_compile_definitions(${TARGET} PRIVATE DISABLE_MAPPREVIEW)
endif()
-list(APPEND RESOURCES app.qrc)
+if(UNIX AND NOT APPLE)
+ set_target_properties(${TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY GPSBabelFE)
+endif()
+# RESOURCES
+list(APPEND RESOURCES app.qrc)
if(WIN32)
list(APPEND RESOURCES app.rc)
endif()
# $Id: app.pro,v 1.19 2010-11-01 03:30:42 robertl Exp $
#
+# set VERSION related variables and generate gbversion.h
+include(../gbversion.pri)
+
+GB.setupfile.input = setup.iss.qmake.in
+GB.setupfile.output = setup.iss
+QMAKE_SUBSTITUTES += GB.setupfile
+
+VERSION = $$GB.VERSION
+
#CONFIG += qt causes link failure on msvc. Qt6EntryPoint.lib not added to libs.
CONFIG(debug, debug|release) {
CONFIG += console
UI_DIR = tmp
-RESOURCES = app.qrc
-RC_FILE = app.rc
-
-win32 {
+unix:!mac{
+ TARGET=gpsbabelfe
+} else {
TARGET=GPSBabelFE
}
+
win32-g++ {
QMAKE_LFLAGS_RELEASE += -static-libgcc
}
-unix:TARGET=gpsbabelfe
-mac:TARGET=GPSBabelFE
# Set QMAKE_TARGET_BUNDLE_PREFIX so we get the correct CFBundleIdentifier in Info.plist
darwin:QMAKE_TARGET_BUNDLE_PREFIX=org.gpsbabel
+# RESOURCES
+RESOURCES = app.qrc
+RC_FILE = app.rc
+
# FORMS
FORMS += aboutui.ui
FORMS += advui.ui
QMAKE_EXTRA_TARGETS += compile_command_database
QMAKE_DISTCLEAN += compile_commands.json
}
-
#include <winver.h>
-#include "../gbversion.h"
+#include "gbversion.h"
IDI_ICON1 ICON "images/appicon.ico"
#include <cstdlib> // for exit
#include "mainwindow.h"
-#include "../gbversion.h" // for VERSION
+#include "gbversion.h" // for VERSION
#include "aboutdlg.h" // for AboutDlg
#include "advdlg.h" // for AdvDlg
#include "appname.h" // for appName
+++ /dev/null
-;\r
-; NOTE: setup.iss is generated from setup.iss.in via configure.\r
-; The generated setup.iss is checked in to help keep the version numbers\r
-; synchronized.\r
-;\r
-; Script for generating installation setup program for GPSBabel\r
-; Uses the Inno setup compiler.\r
-; windeployqt should be run to prepare the necessary Qt files before\r
-; running Inno Setup.\r
-#ifndef package_dir\r
- #define package_dir "..\build-app-Desktop-Release\package"\r
-#endif\r
-\r
-[Setup]\r
-; NOTE: The value of AppId uniquely identifies this application.\r
-; Do not use the same AppId value in installers for other applications.\r
-; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)\r
-AppId={{1B8FE958-A304-4902-BF7A-4E2F0F5B7017}\r
-AppName=GPSBabel\r
-AppVerName=GPSBabel 1.7.0\r
-AppPublisher=GPSBabel\r
-AppPublisherURL=https://www.gpsbabel.org\r
-AppSupportURL=https://www.gpsbabel.org\r
-AppUpdatesURL=https://www.gpsbabel.org\r
-ArchitecturesAllowed=x64\r
-ArchitecturesInstallIn64BitMode=x64\r
-DefaultDirName={pf}\GPSBabel\r
-DefaultGroupName=GPSBabel\r
-OutputDir=release\r
-OutputBaseFilename=GPSBabel-1.7.0-Setup\r
-OutputManifestFile=GPSBabel-1.7.0-Manifest.txt\r
-SetupIconFile=images\babel2.ico\r
-Compression=lzma\r
-SolidCompression=yes\r
-LicenseFile=COPYING.txt\r
-\r
-[Languages]\r
-Name: "english"; MessagesFile: "compiler:Default.isl"\r
-\r
-[Tasks]\r
-Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked\r
-\r
-[Files]\r
-Source: gmapbase.html; DestDir: "{app}"; Flags: ignoreversion\r
-Source: qt.conf; DestDir: "{app}"; Flags: ignoreversion\r
-\r
-Source: "{#package_dir}\*"; Excludes: "vc_redist.*.exe"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs\r
-Source: "{#package_dir}\vc_redist.x86.exe"; DestDir: "{app}"; Flags: ignoreversion skipifsourcedoesntexist deleteafterinstall\r
-Source: "{#package_dir}\vc_redist.x64.exe"; DestDir: "{app}"; Flags: ignoreversion skipifsourcedoesntexist deleteafterinstall\r
-Source: "{#package_dir}\gpsbabel.exe"; DestDir: "{app}"; Flags: ignoreversion\r
-; Source: release\help\*; DestDir: "{app}\help"; Flags: ignoreversion recursesubdirs createallsubdirs\r
-\r
-; Translation strings extracted from source code. Include it in the dist\r
-; so that users can translate if they want to.\r
-; Source: gpsbabel_*.ts; DestDir: "{app}\translations"; Flags: ignoreversion\r
-; Source: gpsbabelfe_*.ts; DestDir: "{app}\translations"; Flags: ignoreversion\r
-\r
-; Compiled translation strings that are used at runtime.\r
-Source: coretool\gpsbabel_*.qm; DestDir: "{app}\translations"; Flags: ignoreversion\r
-Source: gpsbabelfe_*.qm; DestDir: "{app}\translations"; Flags: ignoreversion\r
-\r
-; Miscellaneous\r
-Source: COPYING.txt; DestDir: {app}; Flags: ignoreversion\r
-; Source: AUTHORS; DestDir: {app}; Flags: ignoreversion\r
-; Source: README.contrib; DestDir: {app}; Flags: ignoreversion\r
-; Source: README.gui; DestDir: {app}; Flags: ignoreversion\r
-\r
-\r
-; NOTE: Don't use "Flags: ignoreversion" on any shared system files\r
-\r
-[Icons]\r
-Name: "{group}\GPSBabel"; Filename: "{app}\gpsbabelfe.exe"\r
-Name: "{commondesktop}\GPSBabel"; Filename: "{app}\gpsbabelfe.exe"; Tasks: desktopicon\r
-\r
-[Run]\r
-Filename: "{app}\vc_redist.x86.exe"; Parameters: "/quiet"; Flags: skipifdoesntexist\r
-Filename: "{app}\vc_redist.x64.exe"; Parameters: "/quiet"; Flags: skipifdoesntexist\r
-Filename: "{app}\gpsbabelfe.exe"; Description: "{cm:LaunchProgram,GPSBabelFE}"; Flags: nowait postinstall skipifsilent\r
-\r
-[Registry]\r
-Root: HKCU; Subkey: "Software\GPSBabel"; Flags: uninsdeletekeyifempty\r
-Root: HKCU; Subkey: "Software\GPSBabel\GPSBabel"; Flags: uninsdeletekey\r
-Root: HKCU; Subkey: "Software\GPSBabel\GPSBabelFE"; Flags: uninsdeletekey\r
-\r
-; ISPP preprocessor output can be useful for debug\r
-#expr SaveToFile("PreprocessedScript.iss")\r
#ifndef package_dir\r
#define package_dir "..\build-app-Desktop-Release\package"\r
#endif\r
+#ifndef source_dir\r
+ #define source_dir "."\r
+#endif\r
\r
[Setup]\r
; NOTE: The value of AppId uniquely identifies this application.\r
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)\r
AppId={{1B8FE958-A304-4902-BF7A-4E2F0F5B7017}\r
AppName=GPSBabel\r
-AppVerName=GPSBabel @PACKAGE_VERSION@@PACKAGE_RELEASE@\r
+AppVerName=GPSBabel @GB.VERSION@@GB.PACKAGE_RELEASE@\r
AppPublisher=GPSBabel\r
AppPublisherURL=https://www.gpsbabel.org\r
AppSupportURL=https://www.gpsbabel.org\r
DefaultDirName={pf}\GPSBabel\r
DefaultGroupName=GPSBabel\r
OutputDir=release\r
-OutputBaseFilename=GPSBabel-@PACKAGE_VERSION@@PACKAGE_RELEASE@-Setup\r
-OutputManifestFile=GPSBabel-@PACKAGE_VERSION@@PACKAGE_RELEASE@-Manifest.txt\r
+OutputBaseFilename=GPSBabel-@GB.VERSION@@GB.PACKAGE_RELEASE@-Setup\r
+OutputManifestFile=GPSBabel-@GB.VERSION@@GB.PACKAGE_RELEASE@-Manifest.txt\r
SetupIconFile=images\babel2.ico\r
Compression=lzma\r
SolidCompression=yes\r
+SourceDir="{#source_dir}"\r
LicenseFile=COPYING.txt\r
\r
[Languages]\r
#ifndef package_dir\r
#define package_dir \"..\\build-app-Desktop-Release\\package\"\r
#endif\r
+#ifndef source_dir\r
+ #define source_dir "."\r
+#endif\r
\r
[Setup]\r
; NOTE: The value of AppId uniquely identifies this application.\r
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)\r
AppId={{1B8FE958-A304-4902-BF7A-4E2F0F5B7017}\r
AppName=GPSBabel\r
-AppVerName=GPSBabel $${VERSION}$${GB.PACKAGE_RELEASE}\r
+AppVerName=GPSBabel $${GB.VERSION}$${GB.PACKAGE_RELEASE}\r
AppPublisher=GPSBabel\r
AppPublisherURL=https://www.gpsbabel.org\r
AppSupportURL=https://www.gpsbabel.org\r
DefaultDirName={pf}\\GPSBabel\r
DefaultGroupName=GPSBabel\r
OutputDir=release\r
-OutputBaseFilename=GPSBabel-$${VERSION}$${GB.PACKAGE_RELEASE}-Setup\r
-OutputManifestFile=GPSBabel-$${VERSION}$${GB.PACKAGE_RELEASE}-Manifest.txt\r
+OutputBaseFilename=GPSBabel-$${GB.VERSION}$${GB.PACKAGE_RELEASE}-Setup\r
+OutputManifestFile=GPSBabel-$${GB.VERSION}$${GB.PACKAGE_RELEASE}-Manifest.txt\r
SetupIconFile=images\\babel2.ico\r
Compression=lzma\r
SolidCompression=yes\r
+SourceDir=\"{#source_dir}\"\r
LicenseFile=COPYING.txt\r
\r
[Languages]\r
#include <QtXml/QDomElement> // for QDomElement
#include <QtXml/QDomNode> // for QDomNode
#include <QtXml/QDomNodeList> // for QDomNodeList
-#include "../gbversion.h" // for VERSION
+#include "gbversion.h" // for VERSION
#include "babeldata.h" // for BabelData
#include "format.h" // for Format
LC_ALL=en_US.UTF-8
export LC_ALL
+while :
+do
+ case "$1" in
+ -p) PNAME=$2; shift 2;;
+ -v) VALGRIND=$2; shift 2;;
+ *) break;;
+ esac
+done
+
BASEPATH=`dirname $0`
PNAME=${PNAME:-${BASEPATH}/gpsbabel}
DIFF=${DIFF:-diff}
OD=${OD:-od -Ax -txC -v}
fi
XMLWF=xmlwf
-# set up a variable so we can skip extra tests when running valgrind
-echo "${PNAME}" | grep -q valgrind
-RUNNINGVALGRIND=$?
TMPDIR=${GBTEMP:-/tmp}/gpsbabel.$$
mkdir -p $TMPDIR
gpsbabel()
{
- ${PNAME} "$@" || {
- echo "$PNAME returned error $?"
- echo "($PNAME $@)"
- errorcount=`expr $errorcount + 1`
- #exit 1
- }
+ ${VALGRIND} "${PNAME}" "$@" || {
+ echo "$PNAME returned error $?"
+ echo "($PNAME $@)"
+ errorcount=`expr $errorcount + 1`
+ #exit 1
+ }
}
utf8bomcheck()
{
- if [ ${RUNNINGVALGRIND} -ne 0 ]; then
+ if [ -z "${VALGRIND}" ]; then
if [ "$(dd if=$1 bs=1 count=3 2>/dev/null)" = $'\xef\xbb\xbf' ]; then
echo "ERROR: UTF-8 BOM found in $1"
errorcount=`expr $errorcount + 1`
xmlwfcheck()
{
- if [ ${RUNNINGVALGRIND} -ne 0 ]; then
+ if [ -z "${VALGRIND}" ]; then
if which ${XMLWF} >/dev/null 2>&1; then
# xmlwf is a bit lame, exit status is always 0
rm -f ${TMPDIR}/xmlwf.out
#cp LineStyles.gpx.badchar ${TMPDIR}/bad.gpx
XMLS=$(find ${TMPDIR} -name "*.gpx" -o -name "*.kml")
-if [ ${RUNNINGVALGRIND} -ne 0 ]; then
+if [ -z "${VALGRIND}" ]; then
echo "Running UTF-8 BOM test"
for i in ${XMLS}
do
done
fi
-if [ ${RUNNINGVALGRIND} -ne 0 ]; then
+if [ -z "${VALGRIND}" ]; then
if which ${XMLWF} >/dev/null 2>&1; then
echo "Running well-formed XML test"
for i in ${XMLS}
# gpx file with points with missing timestamps (has 4 trkpts, 2 duplicate times, 1 missing time, expect merge to output 2 valid trkpts)
# expecting this to fail during a standard -x track,merge so call directly rather than via gpsbabel function
-${PNAME} -t -i gpx -f ${REFERENCE}/track/trackfilter_discard.gpx -x track,merge -o csv -F - 2> ${TMPDIR}/discard.err && {
+${VALGRIND} "${PNAME}" -t -i gpx -f ${REFERENCE}/track/trackfilter_discard.gpx -x track,merge -o csv -F - 2> ${TMPDIR}/discard.err && {
echo "$PNAME succeeded! (it shouldn't have with this input...)"
}
# check error message is what we expected
compare ${REFERENCE}/validate_debug.log ${TMPDIR}/validate_debug.log
# expecting this to fail so call directly rather than via gpsbabel function
-${PNAME} -i gpx -f ${REFERENCE}/empty.gpx -x validate,checkempty > /dev/null 2> ${TMPDIR}/validate_empty.log && {
+${VALGRIND} "${PNAME}" -i gpx -f ${REFERENCE}/empty.gpx -x validate,checkempty > /dev/null 2> ${TMPDIR}/validate_empty.log && {
echo "${PNAME} succeeded! (it shouldn't have with this input...)"
}
compare ${REFERENCE}/validate_empty.log ${TMPDIR}/validate_empty.log
# check xmlgeneric can detect no input file
# we expect this to fail
rm -f ${TMPDIR}/xol-sample_si.gpx
-${PNAME} -i xol -f ${REFERENCE}/doesnotexist -o gpx -F ${TMPDIR}/xol-sample_si.gpx 2> ${TMPDIR}/nonexistent.err && {
+${VALGRIND} "${PNAME}" -i xol -f ${REFERENCE}/doesnotexist -o gpx -F ${TMPDIR}/xol-sample_si.gpx 2> ${TMPDIR}/nonexistent.err && {
echo "${PNAME} succeeded! (it shouldn't have with this input...)"
}
# check error message is what we expected.
/mkcapabilities
+/make_gpsbabel_org_wrapper.sh
--- /dev/null
+#!/bin/bash -ex
+#
+# this script is triggered by SCM changes and is run on the build server.
+# output is conditionally mailed to gpsbabel-code.
+#
+# echo some system info to log
+uname -a
+if [ -e /etc/system-release ]; then
+ cat /etc/system-release
+fi
+if [ -e /etc/os-release ]; then
+ cat /etc/os-release
+fi
+git --no-pager log -n 1
+# build and test keeping output within the pwd.
+export GBTEMP=$(pwd)/gbtemp
+mkdir -p $GBTEMP
+cmake . -G Ninja -DCMAKE_BUILD_TYPE=Release -DWEB=$(pwd)/gpsbabel_docdir
+# As of 2018-10, all the virtualized travis build images are two cores per:
+# https://docs.travis-ci.com/user/reference/overview/
+# We'll be slightly abusive on CPU knowing that I/O is virtualized.
+#make toolinfo
+cmake --build . --target clean
+cmake --build .
+cmake --build . --target gpsbabel.html
+cmake --build . --target gpsbabel.pdf
+cmake --build . --target gpsbabel.org
+cmake --build . --target check
+#make -j 3 unix-gui
+# FIXME: use hierarchical build
+pushd gui
+cmake . -G Ninja
+cmake --build .
+popd
+# test for mangled encoding of command line arguments
+./test_encoding_latin1
+./test_encoding_utf8
+#make torture
+cmake --build . --target check-vtesto
+# eat the verbose output from test-all, including crash.output
+# this is a bit risky, if test-all generates an error we won't see what happened.
+echo "test-all in progress... (read/write test between all possible formats)"
+(LIBC_FATAL_STDERR_=1; export LIBC_FATAL_STDERR_; ./test-all -s -r reference/expertgps.gpx >/dev/null 2>&1)
+# summarize the test-all results, and generate an error if a fatal error was
+# detected by test-all.
+./test-all -J
--- /dev/null
+#!/bin/sh
+set -e
+
+web=${WEB:-@WEB@}
+"@CMAKE_SOURCE_DIR@/tools/make_gpsbabel_org.sh" "${web}" "@DOCVERSION@"
& "$($windeployqt)" --verbose 1 --plugindir package\plugins package\GPSBabelFE.exe package\GPSBabel.exe\r
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }\r
if ($buildinstaller -eq "true") {\r
- Set-Location "$($gpsbabel_src_dir)\gui"\r
- & "$($iscc)" /Dpackage_dir="$($gui_build_dir)\package" setup.iss\r
+ & "$($iscc)" /Dpackage_dir="$($gui_build_dir)\package" /Dsource_dir="$($gpsbabel_src_dir)\gui" setup.iss\r
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }\r
}\r
Set-Location "$($gpsbabel_src_dir)"\r
# valgrind 3.11.0 has this problem with Qt 5.12.1.
# It is unknown if 3.12.0 has this problem with Qt 5.12.1.
# valgrind 3.13.0 does not have this problem with Qt 5.12.1.
-# valgrind 3.11.0 is find with Qt 5.9.7.
+# valgrind 3.11.0 is fine with Qt 5.9.7.
# vex amd64->IR: unhandled instruction bytes: 0xF 0xC7 0xF2 0xB9 0x1 0x0 0x0 0x0
vgmajor=$(valgrind --version| cut -d- -f 2 | cut -d. -f 1)
vgminor=$(valgrind --version| cut -d- -f 2 | cut -d. -f 2)
if [ ${vgmajor} -lt 3 ]; then
- vg_vesion_warning
+ vg_version_warning
fi
if [ ${vgmajor} -eq 3 ] ; then
if [ ${vgminor} -le 12 ]; then
fi
fi
-# newer versons of Qt, e.g. 5.12.x, use a JIT compiler for QRegularExpression.
+# newer versions of Qt, e.g. 5.12.x, use a JIT compiler for QRegularExpression.
# JITs use of self-modifying code can confuse valgrind.
# We disable JIT with this environmental variable to keep valgrind happy.
# https://doc.qt.io/qt-5/qregularexpression.html#debugging-code-that-uses-qregularexpression
export QT_ENABLE_REGEXP_JIT=0
-while getopts "lj:" opt; do
+while getopts "lj:p:" opt; do
case $opt in
l) OPTS="--leak-check=full --show-reachable=yes --num-callers=24 --suppressions=${BASEPATH}/gpsbabel.supp" ; QUIET="";;
j) LOG=$OPTARG;;
+ p) PNAME="$OPTARG";;
esac
done
shift $(($OPTIND -1))
+PNAME=${PNAME:-./gpsbabel}
if [ "x$LOG" = "x" ]; then
- PNAME="valgrind $OPTS --error-exitcode=125 $QUIET ./gpsbabel" ${BASEPATH}/testo $*
+ ${BASEPATH}/testo -v "valgrind $OPTS --error-exitcode=125 $QUIET" -p "$PNAME" $*
else
# By default valgrind output goes to file descriptor 2, stderr.
# Some of our tests redirect file descriptor 2 to a file and compare it to an expected result.
# These compares will fail if valgrind sends output to file descriptor 2.
# This option avoids those valgrind induced miscompares by using an alternate file descriptor.
- PNAME="valgrind $OPTS --error-exitcode=125 $QUIET --log-fd=3 ./gpsbabel" ${BASEPATH}/testo $* 3>$LOG
+ ${BASEPATH}/testo -v "valgrind $OPTS --error-exitcode=125 $QUIET --log-fd=3" -p "$PNAME" $* 3>$LOG
fi
#include <winver.h>
-#include "../gbversion.h"
+#include "gbversion.h"
IDI_ICON1 ICON "gpsbabel.ico"